scope-agent-workbench 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE +21 -0
  3. package/README.md +174 -2
  4. package/README.zh-CN.md +175 -0
  5. package/bin/scope.mjs +111 -0
  6. package/bridge/account-quotas.mjs +881 -0
  7. package/bridge/agent-email-relay.mjs +160 -0
  8. package/bridge/app-server-client.mjs +2522 -0
  9. package/bridge/app-server-websocket-transport.mjs +219 -0
  10. package/bridge/archive/routes.mjs +19 -0
  11. package/bridge/archive/service.mjs +130 -0
  12. package/bridge/archive/thread-lifecycle.mjs +52 -0
  13. package/bridge/attachment-store.mjs +184 -0
  14. package/bridge/auth-profile-failover.mjs +58 -0
  15. package/bridge/auth-profile-manager.mjs +215 -0
  16. package/bridge/capacity-recovery.mjs +90 -0
  17. package/bridge/codex-upgrade.mjs +150 -0
  18. package/bridge/deployment-profile.mjs +64 -0
  19. package/bridge/email-notifier.mjs +616 -0
  20. package/bridge/gpu-usage-history.mjs +322 -0
  21. package/bridge/host-session-restart.mjs +35 -0
  22. package/bridge/http.mjs +69 -0
  23. package/bridge/idle-sessions.mjs +185 -0
  24. package/bridge/inventory-scanner.mjs +517 -0
  25. package/bridge/local/dialogue.mjs +150 -0
  26. package/bridge/local/directories.mjs +40 -0
  27. package/bridge/local/executable.mjs +29 -0
  28. package/bridge/local/history.mjs +21 -0
  29. package/bridge/local/python-probe.mjs +35 -0
  30. package/bridge/local/runtime.mjs +188 -0
  31. package/bridge/local/transport.mjs +70 -0
  32. package/bridge/maintenance/install-command.mjs +141 -0
  33. package/bridge/maintenance/routes.mjs +21 -0
  34. package/bridge/maintenance/service.mjs +175 -0
  35. package/bridge/model-catalog.mjs +21 -0
  36. package/bridge/persistent-home-guard.mjs +6 -0
  37. package/bridge/plugins/aliyun-dlc/index.mjs +47 -0
  38. package/bridge/plugins/aliyun-dlc/manifest.mjs +12 -0
  39. package/bridge/plugins/aliyun-dlc/monitor.mjs +236 -0
  40. package/bridge/plugins/aliyun-dlc/probe.mjs +701 -0
  41. package/bridge/plugins/config-store.mjs +35 -0
  42. package/bridge/plugins/external.mjs +87 -0
  43. package/bridge/plugins/package.mjs +96 -0
  44. package/bridge/plugins/registry.mjs +37 -0
  45. package/bridge/plugins/routes.mjs +27 -0
  46. package/bridge/private-gateway.mjs +371 -0
  47. package/bridge/private-start.mjs +22 -0
  48. package/bridge/probes/app-server-handoff-probe.mjs +89 -0
  49. package/bridge/probes/app-server-writer-probe.mjs +72 -0
  50. package/bridge/probes/assistant-search-probe.mjs +323 -0
  51. package/bridge/probes/dialogue-probe.mjs +464 -0
  52. package/bridge/probes/history-probe.mjs +347 -0
  53. package/bridge/probes/index.mjs +15 -0
  54. package/bridge/probes/new-session-preflight.mjs +16 -0
  55. package/bridge/probes/profile-cancel-probe.mjs +19 -0
  56. package/bridge/probes/profile-delete-probe.mjs +28 -0
  57. package/bridge/probes/profile-list-probe.mjs +117 -0
  58. package/bridge/probes/profile-write-probe.mjs +111 -0
  59. package/bridge/probes/raw-context-probe.mjs +53 -0
  60. package/bridge/probes/remote-probe.mjs +636 -0
  61. package/bridge/probes/submission-probe.mjs +2 -0
  62. package/bridge/probes/takeover-probe.mjs +328 -0
  63. package/bridge/probes/vscode-open-preflight.mjs +23 -0
  64. package/bridge/profile-capacity-policy.mjs +14 -0
  65. package/bridge/providers/acp-forms.py +49 -0
  66. package/bridge/providers/antigravity-interactive.mjs +14 -0
  67. package/bridge/providers/antigravity-interactive.py +349 -0
  68. package/bridge/providers/claude-capabilities.py +52 -0
  69. package/bridge/providers/claude-interactive.mjs +14 -0
  70. package/bridge/providers/claude-interactive.py +341 -0
  71. package/bridge/providers/cli-command.mjs +103 -0
  72. package/bridge/providers/codex-workbench.mjs +164 -0
  73. package/bridge/providers/conversation-routes.mjs +28 -0
  74. package/bridge/providers/conversations.mjs +231 -0
  75. package/bridge/providers/native-commands.mjs +48 -0
  76. package/bridge/providers/native-commands.py +38 -0
  77. package/bridge/providers/native-models.mjs +129 -0
  78. package/bridge/providers/native-session-state.mjs +14 -0
  79. package/bridge/providers/native-session-state.py +96 -0
  80. package/bridge/providers/remote-cli.mjs +75 -0
  81. package/bridge/providers/remote-job.py +130 -0
  82. package/bridge/remote-app-server-command.mjs +203 -0
  83. package/bridge/remote-bootstrap/routes.mjs +51 -0
  84. package/bridge/remote-bootstrap/scope-protocol.mjs +125 -0
  85. package/bridge/remote-bootstrap/service.mjs +597 -0
  86. package/bridge/remote-bootstrap/tunnels.mjs +347 -0
  87. package/bridge/remote-directory-listing.mjs +148 -0
  88. package/bridge/remote-images.mjs +140 -0
  89. package/bridge/remote-profile-home.mjs +39 -0
  90. package/bridge/remote-rollout-locks.mjs +31 -0
  91. package/bridge/remote-videos.mjs +129 -0
  92. package/bridge/research/insights.mjs +522 -0
  93. package/bridge/research/scan-host.mjs +18 -0
  94. package/bridge/rollout-summary.mjs +159 -0
  95. package/bridge/routes/accounts.mjs +326 -0
  96. package/bridge/routes/dialogue.mjs +120 -0
  97. package/bridge/routes/email.mjs +50 -0
  98. package/bridge/routes/management.mjs +291 -0
  99. package/bridge/routes/models.mjs +312 -0
  100. package/bridge/routes/runtime.mjs +82 -0
  101. package/bridge/routes/session-commands.mjs +12 -0
  102. package/bridge/routes/session-delivery.mjs +328 -0
  103. package/bridge/routes/session-lifecycle.mjs +839 -0
  104. package/bridge/routes/system.mjs +289 -0
  105. package/bridge/server.mjs +3332 -0
  106. package/bridge/session-attachments.mjs +150 -0
  107. package/bridge/session-cache-archive.mjs +22 -0
  108. package/bridge/session-catalog/agy-history.py +249 -0
  109. package/bridge/session-catalog/catalog.mjs +93 -0
  110. package/bridge/session-catalog/probe.py +331 -0
  111. package/bridge/session-catalog/routes.mjs +28 -0
  112. package/bridge/session-profiles.mjs +115 -0
  113. package/bridge/shared-start.mjs +22 -0
  114. package/bridge/start.mjs +205 -0
  115. package/bridge/state-persistence.mjs +397 -0
  116. package/bridge/submissions/settings.mjs +50 -0
  117. package/bridge/terminal-gateway.mjs +171 -0
  118. package/bridge/tmux-delivery.mjs +390 -0
  119. package/bridge/tmux-session-control.mjs +29 -0
  120. package/bridge/transport/ssh-command.mjs +119 -0
  121. package/bridge/ui-server.mjs +257 -0
  122. package/bridge/vscode-opener.mjs +157 -0
  123. package/bridge/web-terminal.mjs +52 -0
  124. package/bridge/workbench/conversation-routes.mjs +31 -0
  125. package/bridge/workbench/directory-probe.mjs +41 -0
  126. package/bridge/workbench/directory-routes.mjs +112 -0
  127. package/bridge/workbench/manager-context.mjs +51 -0
  128. package/bridge/workbench/routes.mjs +40 -0
  129. package/bridge/workbench/scheduler.mjs +131 -0
  130. package/bridge/workbench/service.mjs +301 -0
  131. package/bridge/workbench/store.mjs +64 -0
  132. package/bridge/workbench/task-archive.mjs +46 -0
  133. package/dist/client/.assetsignore +2 -0
  134. package/dist/client/.vite/manifest.json +366 -0
  135. package/dist/client/_headers +3 -0
  136. package/dist/client/agents/LICENSE.lobe-icons +21 -0
  137. package/dist/client/agents/README.md +14 -0
  138. package/dist/client/agents/antigravity.svg +39 -0
  139. package/dist/client/agents/claude.svg +1 -0
  140. package/dist/client/agents/codex.svg +1 -0
  141. package/dist/client/agents/dsh.svg +4 -0
  142. package/dist/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  143. package/dist/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  144. package/dist/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  145. package/dist/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  146. package/dist/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  147. package/dist/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  148. package/dist/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  149. package/dist/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  150. package/dist/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  151. package/dist/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  152. package/dist/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  153. package/dist/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  154. package/dist/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  155. package/dist/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  156. package/dist/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  157. package/dist/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  158. package/dist/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  159. package/dist/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  160. package/dist/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  161. package/dist/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  162. package/dist/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  163. package/dist/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  164. package/dist/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  165. package/dist/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  166. package/dist/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  167. package/dist/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  168. package/dist/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  169. package/dist/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  170. package/dist/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  171. package/dist/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  172. package/dist/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  173. package/dist/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  174. package/dist/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  175. package/dist/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  176. package/dist/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  177. package/dist/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  178. package/dist/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  179. package/dist/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  180. package/dist/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  181. package/dist/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  182. package/dist/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  183. package/dist/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  184. package/dist/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  185. package/dist/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  186. package/dist/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  187. package/dist/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  188. package/dist/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  189. package/dist/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  190. package/dist/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  191. package/dist/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  192. package/dist/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  193. package/dist/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  194. package/dist/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  195. package/dist/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  196. package/dist/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  197. package/dist/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  198. package/dist/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  199. package/dist/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  200. package/dist/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  201. package/dist/client/assets/_vinext_fonts/geist-8ac0455e797f/geist-001175b1.woff2 +0 -0
  202. package/dist/client/assets/_vinext_fonts/geist-8ac0455e797f/geist-52306abf.woff2 +0 -0
  203. package/dist/client/assets/_vinext_fonts/geist-8ac0455e797f/geist-875ccdd4.woff2 +0 -0
  204. package/dist/client/assets/_vinext_fonts/geist-8ac0455e797f/geist-98bbbccb.woff2 +0 -0
  205. package/dist/client/assets/_vinext_fonts/geist-8ac0455e797f/geist-ff2310f5.woff2 +0 -0
  206. package/dist/client/assets/_vinext_fonts/geist-mono-00e989178794/geist-mono-013b2f2f.woff2 +0 -0
  207. package/dist/client/assets/_vinext_fonts/geist-mono-00e989178794/geist-mono-0638449e.woff2 +0 -0
  208. package/dist/client/assets/_vinext_fonts/geist-mono-00e989178794/geist-mono-44745446.woff2 +0 -0
  209. package/dist/client/assets/_vinext_fonts/geist-mono-00e989178794/geist-mono-44e03052.woff2 +0 -0
  210. package/dist/client/assets/_vinext_fonts/geist-mono-00e989178794/geist-mono-971fb274.woff2 +0 -0
  211. package/dist/client/assets/_vinext_fonts/geist-mono-00e989178794/geist-mono-f6b33328.woff2 +0 -0
  212. package/dist/client/assets/addon-fit-BZbxZs2G.js +1 -0
  213. package/dist/client/assets/framework-CXnKph_e.js +9 -0
  214. package/dist/client/assets/index-CNnP2Ses.css +2 -0
  215. package/dist/client/assets/index-Enu1x0PS.js +3 -0
  216. package/dist/client/assets/layout-segment-context-CmJzExWq.js +1 -0
  217. package/dist/client/assets/page-COBv6VWj.css +1 -0
  218. package/dist/client/assets/page-DVjU6VG_.js +550 -0
  219. package/dist/client/assets/rolldown-runtime-S-ySWqyJ.js +1 -0
  220. package/dist/client/assets/xterm-BBgU7shl.js +36 -0
  221. package/dist/client/favicon.svg +6 -0
  222. package/dist/client/file.svg +1 -0
  223. package/dist/client/globe.svg +1 -0
  224. package/dist/client/og.png +0 -0
  225. package/dist/client/scope-logo.svg +11 -0
  226. package/dist/client/window.svg +1 -0
  227. package/dist/server/.vite/manifest.json +14 -0
  228. package/dist/server/__vite_rsc_assets_manifest.js +49 -0
  229. package/dist/server/assets/index-CNnP2Ses.css +2 -0
  230. package/dist/server/image-config.json +1 -0
  231. package/dist/server/index.js +15201 -0
  232. package/dist/server/ssr/__vite_rsc_assets_manifest.js +49 -0
  233. package/dist/server/ssr/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  234. package/dist/server/ssr/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  235. package/dist/server/ssr/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  236. package/dist/server/ssr/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  237. package/dist/server/ssr/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  238. package/dist/server/ssr/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  239. package/dist/server/ssr/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  240. package/dist/server/ssr/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  241. package/dist/server/ssr/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  242. package/dist/server/ssr/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  243. package/dist/server/ssr/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  244. package/dist/server/ssr/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  245. package/dist/server/ssr/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  246. package/dist/server/ssr/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  247. package/dist/server/ssr/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  248. package/dist/server/ssr/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  249. package/dist/server/ssr/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  250. package/dist/server/ssr/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  251. package/dist/server/ssr/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  252. package/dist/server/ssr/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  253. package/dist/server/ssr/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  254. package/dist/server/ssr/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  255. package/dist/server/ssr/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  256. package/dist/server/ssr/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  257. package/dist/server/ssr/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  258. package/dist/server/ssr/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  259. package/dist/server/ssr/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  260. package/dist/server/ssr/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  261. package/dist/server/ssr/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  262. package/dist/server/ssr/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  263. package/dist/server/ssr/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  264. package/dist/server/ssr/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  265. package/dist/server/ssr/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  266. package/dist/server/ssr/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  267. package/dist/server/ssr/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  268. package/dist/server/ssr/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  269. package/dist/server/ssr/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  270. package/dist/server/ssr/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  271. package/dist/server/ssr/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  272. package/dist/server/ssr/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  273. package/dist/server/ssr/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  274. package/dist/server/ssr/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  275. package/dist/server/ssr/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  276. package/dist/server/ssr/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  277. package/dist/server/ssr/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  278. package/dist/server/ssr/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  279. package/dist/server/ssr/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  280. package/dist/server/ssr/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  281. package/dist/server/ssr/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  282. package/dist/server/ssr/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  283. package/dist/server/ssr/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  284. package/dist/server/ssr/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  285. package/dist/server/ssr/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  286. package/dist/server/ssr/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  287. package/dist/server/ssr/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  288. package/dist/server/ssr/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  289. package/dist/server/ssr/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  290. package/dist/server/ssr/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  291. package/dist/server/ssr/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  292. package/dist/server/ssr/assets/addon-fit-C09Jj0_f.js +42 -0
  293. package/dist/server/ssr/assets/error-boundary-Dd2ZYXA8.js +277 -0
  294. package/dist/server/ssr/assets/layout-segment-context-HV_Mvyzf.js +37 -0
  295. package/dist/server/ssr/assets/page-COBv6VWj.css +1 -0
  296. package/dist/server/ssr/assets/page-CYYyCnKD.js +102541 -0
  297. package/dist/server/ssr/assets/xterm-DgzE4ZZ1.js +10232 -0
  298. package/dist/server/ssr/index.js +11840 -0
  299. package/dist/server/ssr/vinext-server.json +1 -0
  300. package/dist/server/vinext-externals.json +1 -0
  301. package/dist/server/vinext-server.json +1 -0
  302. package/dist/server/wrangler.json +1 -0
  303. package/examples/agents/global-agreements.example.md +10 -0
  304. package/examples/agents/research-project.example.md +10 -0
  305. package/examples/agents-media-previews.md +22 -0
  306. package/examples/deployment.example.json +6 -0
  307. package/examples/leak-denylist.example.json +10 -0
  308. package/examples/plugins/hello/index.mjs +4 -0
  309. package/examples/plugins/hello/scope-plugin.json +13 -0
  310. package/examples/workbench.config.json +44 -0
  311. package/lib/account-quota.d.ts +42 -0
  312. package/lib/account-quota.js +121 -0
  313. package/lib/browser-snapshot-cache.js +61 -0
  314. package/lib/conversation-location.js +26 -0
  315. package/lib/conversation.js +62 -0
  316. package/lib/dialogue-refresh.js +14 -0
  317. package/lib/execution-host.js +22 -0
  318. package/lib/formula-preview.js +48 -0
  319. package/lib/i18n.tsx +81 -0
  320. package/lib/incremental-snapshot.js +324 -0
  321. package/lib/manager-plan.js +37 -0
  322. package/lib/markdown-images.js +22 -0
  323. package/lib/markdown-math.js +151 -0
  324. package/lib/markdown-url.js +13 -0
  325. package/lib/model-effort.js +13 -0
  326. package/lib/native-history.d.ts +32 -0
  327. package/lib/native-history.js +94 -0
  328. package/lib/overview-delta.js +41 -0
  329. package/lib/project-view.js +86 -0
  330. package/lib/projects.js +74 -0
  331. package/lib/remote-links.js +95 -0
  332. package/lib/runtime-config.js +70 -0
  333. package/lib/session-activity.js +34 -0
  334. package/lib/session-cache-guard.js +52 -0
  335. package/lib/session-filters.js +38 -0
  336. package/lib/ssh-config.js +26 -0
  337. package/lib/stable-order.js +39 -0
  338. package/lib/workbench-config.js +172 -0
  339. package/package.json +105 -4
  340. package/scripts/agent-email-relay.mjs +104 -0
  341. package/scripts/benchmark-bridge.mjs +38 -0
  342. package/scripts/cli-integration-smoke.mjs +64 -0
  343. package/scripts/email-notification-cli.mjs +28 -0
  344. package/scripts/enable-private-access.ps1 +109 -0
  345. package/scripts/export-opensource.mjs +112 -0
  346. package/scripts/fixtures/media/convergence.png +0 -0
  347. package/scripts/fixtures/media/rollout_demo.mp4 +0 -0
  348. package/scripts/fixtures/native-conversations.mjs +307 -0
  349. package/scripts/fixtures/workbench-conversations.mjs +352 -0
  350. package/scripts/install-remote-server.sh +67 -0
  351. package/scripts/lib/export-directory.mjs +38 -0
  352. package/scripts/lib/secret-scanner.mjs +139 -0
  353. package/scripts/plugin-cli.mjs +19 -0
  354. package/scripts/preview-workbench.mjs +669 -0
  355. package/scripts/probe-antigravity-acp.mjs +35 -0
  356. package/scripts/remote-bootstrap-cli.mjs +52 -0
  357. package/scripts/remote-email-tool.py +383 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ All notable changes to **SCOPE** (`scope-agent-workbench`) are documented in this file.
4
+
5
+ ## [0.2.0] — 2026-11-24
6
+
7
+ Initial public open-source release of **SCOPE — One monitor for all agent sessions.**
8
+
9
+ ### Highlights
10
+
11
+ - **Unified Multi-Agent Workbench**: Monitor, resume, and steer **Codex** (`app-server` & local), **Claude Code** (`stream-json`), and **Antigravity (`agy` ACP)** sessions across your workstation and remote Linux SSH GPU servers from one local-first Web UI (`127.0.0.1`).
12
+ - **Live Background Subagents & Interactive Approvals**: Track real-time background subagent execution for Claude Code and Antigravity, handle file/command approval cards and interactive forms (`requestUserInput`, `AskUserQuestion`, ACP forms), switch models/reasoning effort, and attach files safely.
13
+ - **3-Agent Account Hub & Live `/usage` Quotas**: Inspect remaining 5-hour / 7-day subscription quotas for Codex (with multi-profile pool & automatic failover), Claude Code (host-local OAuth usage probe without exporting tokens), and Antigravity (`agy -p /usage --output-format json` grouped model quotas), plus built-in Web SSH Terminal login.
14
+ - **Rich-Media Rendering & 3-Client SCOPE Protocol Sync**: Native KaTeX math, GFM pipe tables, inline remote image previews, range-streamed HTML5 video playback (`.mp4`/`.webm`/`.m4v`/`.ogv`/`.mov`), and clickable `file://` line links across Codex, Claude Code, and Antigravity. One-click **Sync SCOPE Protocol** injects operator identity and formatting rules idempotently into `~/.codex/AGENTS.md`, `~/.claude/CLAUDE.md`, and `~/.gemini/config/GEMINI.md`.
15
+ - **GPU Ownership & Session Concurrency Pool**: Real-time `nvidia-smi` telemetry and training process-tree matching, per-host resident session pools (`residentSessionsPerHost`), and explicit **Pin / Reserve** session protection.
16
+ - **Independent CLI Update Proxy & Safe Codex Upgrade**: Configure separate shell commands for agent runtime traffic (`preLaunchCommand`) vs. CLI version checks and updates (`updatePreCommand`), with backup-guarded Codex hot-upgrade and interactive alias support.
17
+ - **npm Package & `scope` CLI**: Install globally (`npm install -g scope-agent-workbench`) or launch via `npx scope-agent-workbench` with prebuilt UI assets, minimal runtime dependencies (`nodemailer`, `ws`), `scope preview`, `scope bootstrap`, and `scope plugin`.
18
+ - **Complete Bilingual Documentation & Plugin Protocol v1**: English and Simplified Chinese deployment, plugin development, and quickstart guides, plus zero-PII bilingual interactive demos and leak-check tooling (`npm run export:opensource -- --check`).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SCOPE Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,175 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/securityCFS/SCOPE/main/docs/assets/scope-hero-anime.jpg" alt="SCOPE — One monitor for all agent sessions." width="100%" />
3
+ </p>
2
4
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
5
+ <h1 align="center">SCOPE</h1>
6
+
7
+ <p align="center">
8
+ <strong>One monitor for all agent sessions.</strong><br/>
9
+ Unify <b>Codex</b>, <b>Claude Code</b>, and <b>Antigravity (<code>agy</code>)</b> across your workstation and Linux SSH GPU servers in one local-first web workbench.
10
+ </p>
11
+
12
+ <p align="center">
13
+ <b>English</b> · <a href="https://github.com/securityCFS/SCOPE/blob/main/README.zh-CN.md">简体中文</a> ·
14
+ <a href="https://github.com/securityCFS/SCOPE/blob/main/docs/deployment.md">Deployment Guide</a> ·
15
+ <a href="https://github.com/securityCFS/SCOPE/blob/main/docs/plugin-protocol.md">Plugin Guide</a>
16
+ </p>
17
+
18
+ <p align="center">
19
+ <a href="https://www.npmjs.com/package/scope-agent-workbench"><img src="https://img.shields.io/npm/v/scope-agent-workbench.svg" alt="npm version" /></a>
20
+ <a href="https://github.com/securityCFS/SCOPE/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT" /></a>
21
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D22.13-brightgreen.svg" alt="Node.js >= 22.13" /></a>
22
+ <img src="https://img.shields.io/badge/agents-Codex%20%7C%20Claude%20Code%20%7C%20Antigravity-6366f1.svg" alt="Supported Agents" />
23
+ <img src="https://img.shields.io/badge/bind-127.0.0.1%20loopback-0ea5e9.svg" alt="Local-first Loopback" />
24
+ </p>
25
+
26
+ ---
27
+
28
+ ## Live Interactive Walkthrough
29
+
30
+ <p align="center">
31
+ <img src="https://raw.githubusercontent.com/securityCFS/SCOPE/main/docs/assets/scope-demo-en.gif" alt="SCOPE interactive demo walkthrough (English UI, synthetic fixture data)" width="100%" />
32
+ </p>
33
+
34
+ <p align="center">
35
+ <sub>Recorded from <code>SCOPE_PREVIEW_LOCALE=en npm run preview:fixture</code> (100% synthetic data): Rich media (GFM tables · KaTeX · inline image &amp; playable video · <code>file://</code> links) → Claude live background subagents &amp; approvals → 3-agent <code>/usage</code> quota hub → 4× A100 GPU telemetry → Dark Mode.</sub>
36
+ </p>
37
+
38
+ | Light Mode (Tables · KaTeX · Inline Image & Video) | Dark Mode (Live Background Subagents · Approvals) |
39
+ | :---: | :---: |
40
+ | <img src="https://raw.githubusercontent.com/securityCFS/SCOPE/main/docs/assets/scope-preview-light-en.png" alt="SCOPE Light Mode preview (English UI)" width="100%" /> | <img src="https://raw.githubusercontent.com/securityCFS/SCOPE/main/docs/assets/scope-preview-dark-en.png" alt="SCOPE Dark Mode preview (English UI)" width="100%" /> |
41
+
42
+ ---
43
+
44
+ ## Why SCOPE?
45
+
46
+ - **One monitor for all agent sessions**: Automatically discovers native sessions you already started in VS Code, terminals, or `tmux` (`~/.codex/sessions`, `~/.claude/projects`, `~/.gemini/antigravity-cli`) and resumes them by native session ID—zero lock-in, zero broken CLI history.
47
+ - **Live streaming, approvals & background subagents**: Approve file edits and shell commands, answer interactive forms (`requestUserInput`, `AskUserQuestion`, ACP forms), queue follow-up messages, switch models/reasoning effort, interrupt turns safely, and watch live **background subagents** (`Claude Code` & `Antigravity`) working in real time.
48
+ - **Multi-agent account hub & live `/usage` quotas**: Inspect login state and live remaining subscription quotas across **Codex** (`app-server` rate limits + multi-profile failover), **Claude Code** (5h / 7d OAuth usage), and **Antigravity** (grouped 5h / weekly quota via `agy -p /usage --output-format json`), plus one-click built-in Web SSH Terminal login.
49
+ - **GPU ownership & session concurrency pool**: Live `nvidia-smi` telemetry and training/evaluation process trees are matched to the sessions owning each GPU. Manage long-running Codex sessions with per-host resident pools and explicit session pinning (**Reserve**).
50
+ - **Cross-project Coordinator**: A read-only coordinator chat with access to your cross-host session and GPU snapshot so you can compare runs, locate stuck jobs, or draft tasks in one place.
51
+ - **Rich media, LaTeX, tables & 3-agent protocol sync**: Renders KaTeX math, GFM tables, inline remote images, range-streamed HTML5 videos, and clickable `file://` line links across Codex, Claude Code, and Antigravity. One-click **Sync SCOPE Protocol** injects formatting rules cleanly into `~/.codex/AGENTS.md`, `~/.claude/CLAUDE.md`, and `~/.gemini/config/GEMINI.md`.
52
+ - **Independent CLI update proxy**: Configure separate shell pre-commands per host for agent API traffic (`preLaunchCommand`) vs. CLI version checks and updates (`updatePreCommand`, e.g. `source ~/.pkg_proxy.sh`), with safe hot-upgrade for Codex sessions.
53
+ - **Local-first & zero baked-in secrets**: Every SSH host, outbound proxy (`preLaunchCommand` / `updatePreCommand`), SMTP credential, gateway token, and local leak denylist stays in your git-ignored `.scope/` directory.
54
+
55
+ ```mermaid
56
+ flowchart LR
57
+ UI["Browser UI (127.0.0.1:3000)\nLight / Dark · EN / 中文"] <-->|HTTP / SSE / WS| Bridge["Local Bridge (127.0.0.1:4815)\nAuth · Quota · Scheduler · Plugins · Relay"]
58
+ Bridge -->|Local app-server / probes| Local["This Workstation"]
59
+ Bridge -->|OpenSSH| Remote1["GPU Host A (Linux)\nCodex · Claude · AGY · GPUs"]
60
+ Bridge -->|OpenSSH| Remote2["GPU Host B (Linux)\nCodex · Claude · AGY · GPUs"]
61
+ Remote1 -.->|"Loopback SSH -R tunnel\n(scope-notify MCP)"| Bridge
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Multi-Agent Support Matrix
67
+
68
+ <p align="center">
69
+ <img src="https://raw.githubusercontent.com/securityCFS/SCOPE/main/docs/assets/scope-agents-anime.jpg" alt="SCOPE orchestrating Codex, Claude Code, and Antigravity across GPU clusters" width="92%" />
70
+ </p>
71
+
72
+ | Capability | Codex | Claude Code | Antigravity (`agy`) | DSH |
73
+ | --- | --- | --- | --- | --- |
74
+ | Live streaming & native session resume | Yes (`app-server` & local) | Yes (`stream-json`) | Yes (`ACP`) | Headless single-turn |
75
+ | Interactive approvals & question forms | Yes | Yes | Yes | — |
76
+ | Model & reasoning effort switching | Yes | Yes | Yes | Profile-based |
77
+ | Live subscription remaining quota (`/usage`) | Yes (5h / 7d + multi-profile) | Yes (5h / 7d OAuth usage) | Yes (grouped 5h / weekly) | — |
78
+ | Background subagents live status | Rollout subagent tree | Yes (live + `subagents/`) | Yes (ACP + child transcripts) | — |
79
+ | Slash commands & project skills | Yes (`skills/list` + `/compact`) | Yes (live CLI commands) | Yes (ACP session commands) | — |
80
+ | External terminal / VS Code observation | Yes (read-only watch) | History scan | History scan | — |
81
+ | Remote CLI check / install / upgrade | Yes (safe hot-switch) | Yes | Version check | Yes |
82
+
83
+ ---
84
+
85
+ ## Quickstart
86
+
87
+ ### Requirements
88
+
89
+ - **Control machine (running SCOPE)**: Windows, macOS, or Linux with **Node.js `>= 22.13`**, **Python 3**, and **OpenSSH (`ssh`)**
90
+ - **Remote servers**: Linux with **Python 3**, key-based non-interactive SSH (`BatchMode=yes`), and `tmux` (for durable Codex sessions)
91
+ - **Agent CLIs**: Installed on the target machines where you run them (`codex`, `claude`, `agy`, or optional `dsh`)
92
+
93
+ ### Option A: Run via npm Package (`scope` CLI)
94
+
95
+ ```sh
96
+ # Install globally
97
+ npm install -g scope-agent-workbench
98
+ scope
99
+
100
+ # Or run directly without cloning
101
+ npx scope-agent-workbench
102
+ # Try zero-SSH interactive preview immediately:
103
+ npx scope-agent-workbench preview --en
104
+ ```
105
+
106
+ ### Option B: Clone & Run from Source
107
+
108
+ ```sh
109
+ git clone https://github.com/securityCFS/SCOPE.git scope
110
+ cd scope
111
+ npm ci
112
+ npm run scope
113
+ ```
114
+
115
+ Open **http://localhost:3000/**. Both the Web UI (`3000`) and Bridge (`4815`) bind strictly to `127.0.0.1`.
116
+
117
+ > Want to preview the full UI locally without connecting any SSH hosts? Run `SCOPE_PREVIEW_LOCALE=en npm run preview:fixture` (or `scope preview --en`) and open `http://127.0.0.1:3001/`.
118
+
119
+ ---
120
+
121
+ ## Optional Local Configuration
122
+
123
+ All runtime state—host pre-launch commands, SMTP secrets (`0600`), remote tunnels, gateway tokens, and installed plugins—lives inside the git-ignored `.scope/` directory:
124
+
125
+ - Copy `examples/deployment.example.json` to `.scope/deployment.json` only if you want to opt into optional integrations (`taskQueue`, `dlcHostname`, `proxyBootstrapHosts`, or legacy `emailTunnelHost`).
126
+ - Copy `examples/leak-denylist.example.json` to `.scope/leak-denylist.json` to block organization-specific hostnames, IPs, or codenames during `npm run export:opensource -- --check`.
127
+
128
+ ---
129
+
130
+ ## Documentation
131
+
132
+ - **[Complete Deployment Guide](https://github.com/securityCFS/SCOPE/blob/main/docs/deployment.md)** — Workstation mode, persistent Linux `systemd --user` server deployment, Tailscale Serve & LAN HTTPS gateways, SSH/proxy setup, concurrency pools, multi-agent quotas, operations, and troubleshooting
133
+ - **[Plugin Integration & Development Guide (v1)](https://github.com/securityCFS/SCOPE/blob/main/docs/plugin-protocol.md)** — End-to-end guide to authoring, inspecting, installing, calling, and securing SCOPE plugins (plus extending built-in views & new agent providers)
134
+ - [Quickstart & SSH Setup](https://github.com/securityCFS/SCOPE/blob/main/docs/getting-started.md) — Short setup reference
135
+ - [Agents, Sessions & Approvals](https://github.com/securityCFS/SCOPE/blob/main/docs/agents-and-sessions.md) — Codex multi-account failover, Claude/AGY streaming, attachments, and reversible archiving
136
+ - [Email Notifications & Remote Bootstrap](https://github.com/securityCFS/SCOPE/blob/main/docs/notifications-and-remote.md) — Web SMTP presets and non-root `scope-notify` MCP deployment
137
+ - [Architecture Overview](https://github.com/securityCFS/SCOPE/blob/main/docs/architecture.md) — Module layout for contributors
138
+ - [Contributing](https://github.com/securityCFS/SCOPE/blob/main/CONTRIBUTING.md) · [Security Model](https://github.com/securityCFS/SCOPE/blob/main/SECURITY.md)
139
+
140
+ ---
141
+
142
+ ## Roadmap
143
+
144
+ SCOPE is currently at an early milestone—we have completed the core multi-agent framework, native session discovery/resume, rich-media rendering, and local-first SSH workbench foundation. Planned next steps include:
145
+
146
+ - [ ] **Self-hosted Cloud Relay & Multi-Device Control**: Customizable cloud-server relay and mobile-first remote control so you can monitor jobs, approve tool calls, and steer agent sessions securely from phones and tablets anywhere.
147
+ - [ ] **Customizable Home & Workspace UI**: Configurable dashboard layouts, custom themes/panels, pinned widgets, and plugin-contributed UI views tailored to your workflow.
148
+ - [ ] **Broader IDE & Editor Integrations**: Native jump-to-line and session handoff beyond VS Code Remote SSH—including Cursor, Windsurf, JetBrains Gateway, Zed, and Neovim.
149
+ - [ ] **Expanded Agent & Cluster Ecosystem**: Additional coding-agent backends, Slurm / Kubernetes / Ray cluster plugins, and richer push notification channels (Webhook, Telegram, Lark/Feishu, Slack, Discord).
150
+
151
+ ---
152
+
153
+ ## Contributing
154
+
155
+ Issues, feature proposals, plugins, and pull requests are warmly welcome! Whether you are reporting a bug, improving documentation, adding an IDE/agent adapter, or shaping the roadmap:
156
+
157
+ - Open an [Issue](https://github.com/securityCFS/SCOPE/issues) for bugs, ideas, or workflow requests.
158
+ - Submit a [Pull Request](https://github.com/securityCFS/SCOPE/pulls) following [CONTRIBUTING.md](https://github.com/securityCFS/SCOPE/blob/main/CONTRIBUTING.md).
159
+ - Star the repo if SCOPE helps keep your agent sessions under control.
160
+
161
+ ---
162
+
163
+ ## Development & Verification
164
+
165
+ ```sh
166
+ npm run typecheck
167
+ npm run build
168
+ npm run test:unit
169
+ npm run lint
170
+ npm run export:opensource -- --check
171
+ ```
172
+
173
+ ## License
174
+
175
+ [MIT](https://github.com/securityCFS/SCOPE/blob/main/LICENSE)
@@ -0,0 +1,175 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/securityCFS/SCOPE/main/docs/assets/scope-hero-anime.jpg" alt="SCOPE — One monitor for all agent sessions." width="100%" />
3
+ </p>
4
+
5
+ <h1 align="center">SCOPE</h1>
6
+
7
+ <p align="center">
8
+ <strong>One monitor for all agent sessions.</strong><br/>
9
+ 用一个本机优先的网页工作台,统一监控与驾驭本机及多台 Linux SSH GPU 服务器上的 <b>Codex</b>、<b>Claude Code</b> 与 <b>Antigravity (<code>agy</code>)</b> 会话。
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="https://github.com/securityCFS/SCOPE/blob/main/README.md">English</a> · <b>简体中文</b> ·
14
+ <a href="https://github.com/securityCFS/SCOPE/blob/main/docs/deployment.zh-CN.md">完备部署指南</a> ·
15
+ <a href="https://github.com/securityCFS/SCOPE/blob/main/docs/plugin-protocol.zh-CN.md">插件接入指南</a>
16
+ </p>
17
+
18
+ <p align="center">
19
+ <a href="https://www.npmjs.com/package/scope-agent-workbench"><img src="https://img.shields.io/npm/v/scope-agent-workbench.svg" alt="npm version" /></a>
20
+ <a href="https://github.com/securityCFS/SCOPE/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT" /></a>
21
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D22.13-brightgreen.svg" alt="Node.js >= 22.13" /></a>
22
+ <img src="https://img.shields.io/badge/agents-Codex%20%7C%20Claude%20Code%20%7C%20Antigravity-6366f1.svg" alt="支持 Agent" />
23
+ <img src="https://img.shields.io/badge/bind-127.0.0.1%20loopback-0ea5e9.svg" alt="本机回环监听" />
24
+ </p>
25
+
26
+ ---
27
+
28
+ ## 实机交互体验演示
29
+
30
+ <p align="center">
31
+ <img src="https://raw.githubusercontent.com/securityCFS/SCOPE/main/docs/assets/scope-demo-zh.gif" alt="SCOPE 实机交互演示(中文界面,全程脱敏虚拟数据)" width="100%" />
32
+ </p>
33
+
34
+ <p align="center">
35
+ <sub>基于 <code>npm run preview:fixture</code> 隔离虚拟数据录制(零真实会话与隐私):富媒体渲染(表格 · KaTeX 公式 · 内嵌图片与可播放视频 · <code>file://</code> 跳转)→ Claude 后台子代理与审批卡片 → 三 Agent <code>/usage</code> 实时额度中心 → 4× A100 GPU 负载 → 深色模式。</sub>
36
+ </p>
37
+
38
+ | 浅色模式(表格 · 公式 · 图片与视频内嵌预览) | 深色模式(后台子代理实时追踪 · 交互审批) |
39
+ | :---: | :---: |
40
+ | <img src="https://raw.githubusercontent.com/securityCFS/SCOPE/main/docs/assets/scope-preview-light-zh.png" alt="SCOPE 浅色模式预览(中文界面)" width="100%" /> | <img src="https://raw.githubusercontent.com/securityCFS/SCOPE/main/docs/assets/scope-preview-dark-zh.png" alt="SCOPE 深色模式预览(中文界面)" width="100%" /> |
41
+
42
+ ---
43
+
44
+ ## 核心特性
45
+
46
+ - **One monitor for all agent sessions**:零侵入扫描你在终端、VS Code 或 `tmux` 里启动过的原生会话(`~/.codex/sessions`、`~/.claude/projects`、`~/.gemini/antigravity-cli`),直接按原生会话 ID 续聊,不破坏原有 CLI 历史。
47
+ - **实时流式交互、审批与后台子代理**:支持 Codex、Claude Code 和 Antigravity 的文件修改/命令审批、交互问答卡片、运行中追加消息、模型/推理强度切换、安全中断,以及 **Claude Code / Antigravity 后台子代理实时工作状态** 追踪。
48
+ - **多 Agent 账号中心与实时 `/usage` 额度**:统一查看 **Codex**(多 Profile 池 + 故障自动切换 + 5h/周额度)、**Claude Code**(本地 OAuth 实时 5h/7d 额度)和 **Antigravity**(官方 `agy -p /usage --output-format json` 分组 5h/周额度)的登录态与余量,并支持一键打开内置 Web SSH 终端登录/切换账号。
49
+ - **GPU 归属与会话并发池**:实时采集各主机 `nvidia-smi` 显存/利用率和训练进程树,自动关联到对应 Agent 会话;提供按主机的常驻会话并发池(`residentSessionsPerHost`)与会话 **保留(Pin)** 机制,避免重要长程任务被误回收。
50
+ - **跨项目总调度(Coordinator)**:只读汇总各主机状态、会话进展和 GPU 资源,在一个对话框里对比实验、定位异常或起草下一步任务。
51
+ - **富媒体渲染与三端 SCOPE 协议一键注入**:原生支持 KaTeX 公式、GFM 表格、远端图片内嵌、HTML5 视频流式预览与 `file://` 行号跳转(全面兼容 Antigravity 的 `file://` 链接习惯),并支持一键向 `~/.codex/AGENTS.md`、`~/.claude/CLAUDE.md` 与 `~/.gemini/config/GEMINI.md` 注入规范协议。
52
+ - **独立 CLI 更新代理路径**:每台主机支持分别配置 Agent 对话运行代理(`preLaunchCommand`)与 CLI 版本检测/更新独立代理(`updatePreCommand`,如 `source ~/.pkg_proxy.sh` 或独立代理别名),互不干扰且支持 Codex 安全热升级。
53
+ - **本机优先、零硬编码密钥**:所有 SSH 主机、出口代理命令(`preLaunchCommand` / `updatePreCommand`)、SMTP 凭据、网关令牌与本地防泄漏词表全部存放在 Git 忽略的 `.scope/` 目录中。
54
+
55
+ ```mermaid
56
+ flowchart LR
57
+ UI["浏览器工作台 (127.0.0.1:3000)\n浅/深色主题 · 中/英文切换"] <-->|HTTP / SSE / WS| Bridge["本机 Bridge (127.0.0.1:4815)\nSSH 调度 · 额度探测 · 插件 · 邮件中继"]
58
+ Bridge -->|本机 app-server / 探测| Local["当前工作电脑"]
59
+ Bridge -->|OpenSSH| Remote1["GPU 主机 A (Linux)\nCodex · Claude · AGY · GPUs"]
60
+ Bridge -->|OpenSSH| Remote2["GPU 主机 B (Linux)\nCodex · Claude · AGY · GPUs"]
61
+ Remote1 -.->|"回环 SSH -R 隧道\n(scope-notify MCP)"| Bridge
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Agent 能力矩阵
67
+
68
+ <p align="center">
69
+ <img src="https://raw.githubusercontent.com/securityCFS/SCOPE/main/docs/assets/scope-agents-anime.jpg" alt="SCOPE 协同编排 Codex、Claude Code 与 Antigravity" width="92%" />
70
+ </p>
71
+
72
+ | 能力 | Codex | Claude Code | Antigravity (`agy`) | DSH |
73
+ | --- | --- | --- | --- | --- |
74
+ | 实时流式对话与原生续聊 | 支持(`app-server` 与本机) | 支持(`stream-json`) | 支持(`ACP`) | Headless 单次任务 |
75
+ | 网页审批与提问表单 | 支持 | 支持 | 支持 | — |
76
+ | 模型与推理强度切换 | 支持 | 支持 | 支持 | 由远端 profile 控制 |
77
+ | 订阅剩余额度实时查询(`/usage`) | 支持(5h/周 + 多账号) | 支持(5h/7d OAuth 实时用量) | 支持(分组 5h/周实时额度) | — |
78
+ | 后台子代理实时状态显示 | Rollout 子代理树 | 支持(实时 + `subagents/`) | 支持(ACP + 子会话日志) | — |
79
+ | `/` 命令与项目技能 | 支持(`skills/list` + `/compact`) | 支持(实时读取 CLI 命令) | 支持(ACP 会话命令) | — |
80
+ | 外部终端 / VS Code 会话观察 | 支持(只读观察) | 历史扫描 | 历史扫描 | — |
81
+ | 网页检查 / 安装 / 更新 CLI | 支持(含安全热切换) | 支持 | 支持版本检查 | 支持 |
82
+
83
+ ---
84
+
85
+ ## 快速开始
86
+
87
+ ### 环境要求
88
+
89
+ - **控制端电脑**:Windows / macOS / Linux,已安装 **Node.js `>= 22.13`**、**Python 3** 和 **OpenSSH 客户端(`ssh`)**
90
+ - **远端主机**:Linux,已安装 **Python 3**、配置免密 SSH 登录(`BatchMode=yes` 可直连),Codex 托管会话建议安装 `tmux`
91
+ - **Agent CLI**:在目标机器上预先安装并登录对应工具(`codex`、`claude`、`agy` 或可选 `dsh`)
92
+
93
+ ### 方式 A:通过 npm 包直接安装运行(推荐)
94
+
95
+ ```sh
96
+ # 全局安装
97
+ npm install -g scope-agent-workbench
98
+ scope
99
+
100
+ # 或无需克隆直接运行
101
+ npx scope-agent-workbench
102
+ # 免配 SSH 立即体验完整交互预览:
103
+ npx scope-agent-workbench preview
104
+ ```
105
+
106
+ ### 方式 B:克隆源码启动
107
+
108
+ ```sh
109
+ git clone https://github.com/securityCFS/SCOPE.git scope
110
+ cd scope
111
+ npm ci
112
+ npm run scope
113
+ ```
114
+
115
+ 打开 **http://localhost:3000/**。前端(`3000`)与 Bridge(`4815`)默认只监听 `127.0.0.1`。
116
+
117
+ > 想先免配 SSH 体验完整界面?直接运行 `npm run preview:fixture`(或 `scope preview`),然后访问 `http://127.0.0.1:3001/`。
118
+
119
+ ---
120
+
121
+ ## 可选本地配置
122
+
123
+ 所有运行态数据——主机启动前命令、SMTP 凭据(`0600`)、远程隧道、网关密钥与已导入插件——全部存放在 Git 忽略的 `.scope/` 目录中:
124
+
125
+ - 如需开启实验任务队列(`taskQueue`)或预配置内置集群主机,可复制 `examples/deployment.example.json` 为 `.scope/deployment.json`。
126
+ - 如需在执行 `npm run export:opensource -- --check` 时拦截团队内网 IP、主机名或代号,可复制 `examples/leak-denylist.example.json` 为 `.scope/leak-denylist.json`。
127
+
128
+ ---
129
+
130
+ ## 完整文档导航
131
+
132
+ - **[完备部署指南](https://github.com/securityCFS/SCOPE/blob/main/docs/deployment.zh-CN.md)** — 本机模式、Linux `systemd --user` 常驻部署、Tailscale / 局域网 HTTPS 私有网关、代理与环境配置、并发池、多 Agent 额度、运维排障与安全清单
133
+ - **[插件接入与开发指南 (v1)](https://github.com/securityCFS/SCOPE/blob/main/docs/plugin-protocol.zh-CN.md)** — 从零编写、校验、安装、调用与卸载 SCOPE 插件的完整手册(含协议字段、生命周期、HTTP API、扩展新 Agent 说明)
134
+ - [快速上手速查](https://github.com/securityCFS/SCOPE/blob/main/docs/getting-started.zh-CN.md) — 精简版启动与 SSH 配置说明
135
+ - [多 Agent 会话、审批与账号管理](https://github.com/securityCFS/SCOPE/blob/main/docs/agents-and-sessions.zh-CN.md) — Codex 多账号故障切换、Claude/AGY 实时交互、附件上传与可逆归档
136
+ - [邮件通知与远端一键初始化](https://github.com/securityCFS/SCOPE/blob/main/docs/notifications-and-remote.zh-CN.md) — Web SMTP 预设、本地 `0600` 凭据与非 root 的 `scope-notify` 部署
137
+ - [架构说明](https://github.com/securityCFS/SCOPE/blob/main/docs/architecture.zh-CN.md) — 前后端目录与模块职责
138
+ - [贡献指南](https://github.com/securityCFS/SCOPE/blob/main/CONTRIBUTING.md) · [安全说明](https://github.com/securityCFS/SCOPE/blob/main/SECURITY.md)
139
+
140
+ ---
141
+
142
+ ## 路线图(Roadmap)
143
+
144
+ 目前 SCOPE 仅初步完成了多 Agent 统一监控框架、原生会话接管、富媒体渲染与本机优先 SSH 工作台的基础能力,后续重点 TODO 包括:
145
+
146
+ - [ ] **自定义云服务器多端控制方案(如手机端控制)**:提供可自建的云服务器中继与移动端友好交互方案,随时随地通过手机、平板安全查看任务进度、审批高风险操作并向 Agent 追加指令。
147
+ - [ ] **主界面与工作台高度自定义**:支持自定义首页布局、主题风格、快捷看板、置顶模块与插件自定义视图,按团队或个人科研/研发习惯灵活编排界面。
148
+ - [ ] **更多 IDE 与编辑器深度联动**:在现有 VS Code Remote SSH 跳转之外,扩展支持 Cursor、Windsurf、JetBrains Gateway、Zed、Neovim 等主流 IDE/编辑器的双向联动。
149
+ - [ ] **更多 Agent 后端与集群插件生态**:持续接入更多编程 Agent、Slurm / Kubernetes / Ray 等集群调度器插件,以及 Webhook、飞书、钉钉、Slack、Telegram 等多渠道推送。
150
+
151
+ ---
152
+
153
+ ## 欢迎参与贡献(Contributing)
154
+
155
+ 非常欢迎大家提 **Issue**、提交 **PR** 和参与社区共建!无论是反馈 Bug、提出新场景需求、贡献插件/新 IDE 适配,还是完善文档:
156
+
157
+ - 提交 Bug 或功能建议:[GitHub Issues](https://github.com/securityCFS/SCOPE/issues)
158
+ - 参与代码或文档贡献:[Pull Requests](https://github.com/securityCFS/SCOPE/pulls)(请参考 [CONTRIBUTING.md](https://github.com/securityCFS/SCOPE/blob/main/CONTRIBUTING.md))
159
+ - 如果 SCOPE 帮到了你,欢迎点个 Star 支持项目持续演进!
160
+
161
+ ---
162
+
163
+ ## 本地校验
164
+
165
+ ```sh
166
+ npm run typecheck
167
+ npm run build
168
+ npm run test:unit
169
+ npm run lint
170
+ npm run export:opensource -- --check
171
+ ```
172
+
173
+ ## 开源协议
174
+
175
+ [MIT](https://github.com/securityCFS/SCOPE/blob/main/LICENSE)
package/bin/scope.mjs ADDED
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from "node:child_process";
3
+ import { existsSync, readFileSync } from "node:fs";
4
+ import os from "node:os";
5
+ import path from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ const packageRoot = fileURLToPath(new URL("..", import.meta.url));
9
+ const pkg = JSON.parse(readFileSync(path.join(packageRoot, "package.json"), "utf8"));
10
+ const argv = process.argv.slice(2);
11
+ const command = argv[0] && !argv[0].startsWith("-") ? argv[0] : "start";
12
+ const rest = argv[0] && !argv[0].startsWith("-") ? argv.slice(1) : argv;
13
+
14
+ function printHelp() {
15
+ console.log(`SCOPE — One monitor for all agent sessions (v${pkg.version})
16
+
17
+ Usage:
18
+ scope [start] [options] Start SCOPE Web UI + Bridge (127.0.0.1)
19
+ scope preview [--en] Launch isolated zero-SSH preview mode
20
+ scope bootstrap <action> <host|@local> Run remote inspect / deploy / sync-protocol / remove
21
+ scope plugin <subcommand> [args...] Inspect, install, call, or remove SCOPE plugins
22
+ scope --version Print version
23
+ scope --help Show this help
24
+
25
+ Start options:
26
+ --port <port> Web UI port (default: 3000, env: SCOPE_UI_PORT)
27
+ --bridge-port <port> Bridge API port (default: 4815, env: SCOPE_BRIDGE_PORT)
28
+ --state-dir <dir> State directory (default: ./.scope in repo or ~/.scope globally)
29
+ --skip-build Use prebuilt UI bundle without rebuilding
30
+ --build Force rebuild UI before starting (source checkout only)
31
+ --dev Start Vite/vinext development server (source checkout only)
32
+
33
+ Repository: https://github.com/securityCFS/SCOPE`);
34
+ }
35
+
36
+ if (argv.includes("--version") || argv.includes("-v")) {
37
+ console.log(`${pkg.name} v${pkg.version}`);
38
+ process.exit(0);
39
+ }
40
+
41
+ if (argv.includes("--help") || argv.includes("-h") || command === "help") {
42
+ printHelp();
43
+ process.exit(0);
44
+ }
45
+
46
+ function readFlag(args, name) {
47
+ const index = args.indexOf(name);
48
+ if (index < 0 || index + 1 >= args.length) return null;
49
+ return args[index + 1];
50
+ }
51
+
52
+ function runScript(relativeScript, args, extraEnv = {}) {
53
+ const target = path.join(packageRoot, relativeScript);
54
+ const child = spawn(process.execPath, [target, ...args], {
55
+ stdio: "inherit",
56
+ env: { ...process.env, ...extraEnv },
57
+ });
58
+ child.on("exit", (code, signal) => {
59
+ if (signal) process.kill(process.pid, signal);
60
+ process.exit(code ?? 0);
61
+ });
62
+ for (const sig of ["SIGINT", "SIGTERM"]) {
63
+ process.on(sig, () => {
64
+ if (!child.killed) child.kill(sig);
65
+ });
66
+ }
67
+ }
68
+
69
+ function defaultStateDir(explicit) {
70
+ if (explicit) return path.resolve(explicit);
71
+ if (process.env.SCOPE_STATE_DIR) return path.resolve(process.env.SCOPE_STATE_DIR);
72
+ const cwdScope = path.resolve(process.cwd(), ".scope");
73
+ if (existsSync(cwdScope) || path.resolve(process.cwd()) === path.resolve(packageRoot)) {
74
+ return cwdScope;
75
+ }
76
+ return path.join(os.homedir(), ".scope");
77
+ }
78
+
79
+ if (command === "start") {
80
+ const uiPort = readFlag(rest, "--port");
81
+ const bridgePort = readFlag(rest, "--bridge-port");
82
+ const stateDir = defaultStateDir(readFlag(rest, "--state-dir"));
83
+ const forwardArgs = [];
84
+ if (rest.includes("--dev")) forwardArgs.push("--dev");
85
+ if (rest.includes("--skip-build")) forwardArgs.push("--skip-build");
86
+ if (rest.includes("--build")) forwardArgs.push("--build");
87
+ const prebuiltReady = existsSync(path.join(packageRoot, "dist", "server", "index.js"));
88
+ if (prebuiltReady && !forwardArgs.includes("--dev") && !forwardArgs.includes("--build") && !forwardArgs.includes("--skip-build")) {
89
+ forwardArgs.push("--skip-build");
90
+ }
91
+ runScript("bridge/start.mjs", forwardArgs, {
92
+ SCOPE_STATE_DIR: stateDir,
93
+ ...(uiPort ? { SCOPE_UI_PORT: uiPort } : {}),
94
+ ...(bridgePort ? { SCOPE_BRIDGE_PORT: bridgePort } : {}),
95
+ });
96
+ } else if (command === "preview") {
97
+ const isEn = rest.includes("--en") || rest.includes("--english");
98
+ runScript("scripts/preview-workbench.mjs", [], isEn ? { SCOPE_PREVIEW_LOCALE: "en" } : {});
99
+ } else if (command === "bootstrap") {
100
+ runScript("scripts/remote-bootstrap-cli.mjs", rest, {
101
+ SCOPE_STATE_DIR: defaultStateDir(null),
102
+ });
103
+ } else if (command === "plugin") {
104
+ runScript("scripts/plugin-cli.mjs", rest, {
105
+ SCOPE_STATE_DIR: defaultStateDir(null),
106
+ });
107
+ } else {
108
+ console.error(`[scope] Unknown command: ${command}`);
109
+ printHelp();
110
+ process.exit(1);
111
+ }